package Fixtures::StatsSummary;
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
use Moose;
extends 'DBIx::Class::EasyFixture';
use namespace::autoclean;

my %definition_for = (
	## id => 1
	stat1 => {
		new   => 'StatsSummary',
		using => {
			cdn_name => "cdn1",
      deliveryservice_name => "test-ds1",
      stat_name => "test_stat",
      stat_value => "1",
      stat_date => "2016-07-25"
		},
	},
);

sub get_definition {
	my ( $self, $name ) = @_;
	return $definition_for{$name};
}


sub all_fixture_names {
	# sort by db stat_name to guarantee insertion order
	return (sort { $definition_for{$a}{using}{stat_name} cmp $definition_for{$b}{using}{stat_name} } keys %definition_for);
}
__PACKAGE__->meta->make_immutable;

1;
